<html>
<head>
  <TITLE>UploadBean - Developer guide</TITLE>
<STYLE TYPE="text/css">
<!--
a {  font-family: Verdana, Arial, Helvetica, sans-serif; color: #0000FF; text-decoration: none}
a:hover {  font-family: Verdana, Arial, Helvetica, sans-serif; color: #333333; text-decoration: underline}
-->
</STYLE>
</head>

<body bgcolor="#FFFFFF" onLoad="" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#333333" vlink="#6666FF" alink="#333333">
<table width="770" border="0" name="Main" height="600" cellpadding="0" cellspacing="0" vspace="0" hspace="0">
  <tr>
    <td>
      <table width="770" border="0" name="Head" height="86" cellpadding="0" cellspacing="0" vspace="0" hspace="0">
        <tr>
          <td width="279" height="86"><a href="http://www.javazoom.net" target="_top"><img src="finemenu/title.gif" width="279" height="86" border="0" alt="JavaZOOM Web Site" vspace="0" hspace="0"></a></td>
          <td width="491" height="86" align="center"><a href="http://www.javazoom.net/jzservlets/uploadbean/uploadbean.html" target="_top"><img src="img/uploadbean.gif" width="400" height="43" border="0" alt="UploadBean homepage"></a></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td height="514">
      <table width="770" border="0" height="1028" name="Body" cellpadding="0" cellspacing="0" vspace="0" hspace="0">
        <tr nowrap>
          <td height="514" width="146" valign="top">
            <table width="146" border="0" height="514" cellpadding="0" cellspacing="0" vspace="0" hspace="0">
              <tr nowrap align="left">
                <td width="146" height="146" background="finemenu/middle.gif"> 
                  <b><font face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<font color="#000066">&#149;</font></font><font face="Verdana, Arial, Helvetica, sans-serif" size="-1">&nbsp;</font></b><font color="#000099" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><b><a href="software.html" target="_top">Software</a></b></font><b><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><br>
                  </font><font face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<font color="#000066">&#149;</font></font>&nbsp;</b><font color="#000099" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><b><a href="installation.html">Installation</a></b></font><b><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><br>
                  </font><font face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<font color="#000066">&#149;</font></font>&nbsp;</b><font face="Verdana, Arial, Helvetica, sans-serif" size="-1" color="#000066"><b>Developer 
                  Guide</b></font><b><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><br>
                  </font></b><b><font face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<font color="#000066">&#149;</font></font>&nbsp;</b><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><a href="api.html" target="_top"><b>API 
                  &amp; Design</b></a></font><b><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><br>
                  </font><font face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<font color="#000066">&#149;</font></font>&nbsp;</b><font face="Verdana, Arial, Helvetica, sans-serif" size="-1"><b><a href="license.html" target="_top">License</a></b></font> </td>
              </tr>
              <tr nowrap align="center">
                <td width="146" height="167" background="finemenu/bottom.gif">
                  <a href="applets/jads21/jads.html" target="_self"><br>
                  </a></td>
              </tr>
              <tr nowrap align="center" valign="top">
                <td width="146" height="201"><font size="-2"><a href="index.html">&lt;&lt; back</a></font> </td>
              </tr>
            </table>
          </td>
          <td height="514" width="624" align="center" valign="top"> 
            <table width="95%" border="0" cellspacing="1" cellpadding="0" align="center">
              <tr> 
                <td valign="top" height="103"> 
                  <p align="center"><font color="#000099" face="Verdana, Arial, Helvetica, sans-serif"><b>- Developer Guide -</b></font></p>
                  <p><font face="Verdana, Arial, Helvetica, sans-serif"><font size="-1"><b>UploadBean </b>is a JavaBean (JAVA component) that allows to upload files in store. This store could be a folder, a ZIP archive, a database or memory. This document is a guide for developers. We assume that developers have a few JavaBeans and JSP skills and they know what &quot;scope&quot; (page, session, application) is for JavaBeans. <br>
First of all, you need to select a store model : [<a href="developerguide.html#folder">Folder</a>] [<a href="developerguide.html#zip">ZIP Archive</a>] [<a href="developerguide.html#database">Database</a>] [<a href="developerguide.html#memory">Memory</a>]. Once selected, you could switch to another model through [<a href="developerguide.html#setstoremodel">setStoreModel</a>] method. Second, you can add some restrictions on uploaded files like a [<a href="developerguide.html#blacklist">blacklist</a>] or </font><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">a [<a href="developerguide.html#whitelist">whitelist</a>]</font><font size="-1">, a [<a href="developerguide.html#limit">file size limit</a>] and a [<a href="developerguide.html#max">maximum</a>] store size. To store uploaded files, you have to call [<a href="developerguide.html#storecall">store</a>] method with a [<a href="developerguide.html#mp">MultipartFormDataRequest</a>] object </font><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">(see [<a href="developerguide.html#overwrite">overwrite</a>] options for duplicate entries)</font><font size="-1">. Finally, you can [<a href="developerguide.html#clean">reset</a>] store if needed. Any object implementing [<a href="developerguide.html#listener">UploadListener</a>] interface could be notified when an uploaded file is stored. Note that an [<a href="developerguide.html#history">history</a>] of uploaded parameters (files without binary data) is available. Finally, UploadBean supports three multipart parsers. You could select one through [<a href="developerguide.html#parser">parser</a>] property.<br>
                    <br>
                    </font></font></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td valign="top" bgcolor="#FFFFCC"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;<img src="img/right_red-arrow.gif" width="18" height="14" align="absmiddle">&nbsp;</font><font color="#FF0000">Folder </font><font color="#FF0000">:</font><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><a name="folder"></a></font></b></font></td>
                    </tr>
                  </table>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><font size="-2" face="Verdana, Arial, Helvetica, sans-serif"><b><img src="img/folder.gif" width="45" height="39" align="left"></b></font>UploadBean can store uploaded files in any folder or directory. The folder must have read/write access. Uploaded files will be added under this folder. <br>
                      <br>
One method is available to initialize the folder store :<br>
</font></p>
                  <ul>
                    <li><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">public void <b>setFolderstore</b>(String serverfolder)<br>
                        <font color="#666666">Input parameter is the full path to the folder (e.g. /usr/uploads).</font><br>
                        <font color="#666666">This method will create an empty folder if needed.</font></font><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><br>
</font></li>
                  </ul>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Here is a sample under a Win32 OS. We assume that D:\Inetpub\uploads\ folder is RW for the process running the Servlets/JSP Engine.<br>
</font></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td bgcolor="#333333"> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td bgcolor="#EEEEEE"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">&lt;jsp:useBean id=&quot;upBean&quot; scope=&quot;page&quot; class=&quot;javazoom.upload.UploadBean&quot;&gt;<br>
</font><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;&nbsp;&lt;jsp:setProperty name=&quot;<b>upBean</b>&quot; property=&quot;<b><font color="#FF0000">folderstore</font></b>&quot; <br>
&nbsp;&nbsp; value=&quot;<b>D:/Inetpub/uploads</b>&quot; /&gt;<br>
&lt;/jsp:useBean&gt;</font></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><u><font color="#333333" size="-2"><b>Notes</b></font></u><font color="#333333"><b><font size="-2"> : </font></b><font size="-2"><br>
1 - Don't pay attention about &quot;/&quot; or &quot;\&quot; in path. UploadBean will use always use the good one.<br>
2 - DO NOT add &quot;/&quot; or &quot;\&quot; at the end <br>
3 - </font><font size="-2" face="Verdana, Arial, Helvetica, sans-serif">A full sample is available through <a href="../SimpleUpload.jsp">SimpleUpload.jsp</a></font></font><br>
</font></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td valign="top" bgcolor="#FFFFCC"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/right_red-arrow.gif" width="18" height="14" align="absmiddle">&nbsp;</font><font color="#FF0000">ZIP Archive </font><font color="#FF0000">:</font><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><a name="zip"></a></font></b></font></td>
                    </tr>
                  </table>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><font size="-2" face="Verdana, Arial, Helvetica, sans-serif"><b><img src="img/zip.gif" width="40" height="35" align="left"></b></font>UploadBean can store uploaded files in a ZIP archive. The folder containing the ZIP file must have read/write access. Uploaded files will be appended to the archive by creating a temporary archive.<br>
                      <br>
One method is available to initialize the ZIP store :<br>
</font></p>
                  <ul>
                    <li><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">public void <b>setZipfilestore</b>(String file)<br>
                        <font color="#666666">Input parameter is the full path to the ZIP file (e.g. /usr/upload/uploaded.zip).</font><br>
                        <font color="#666666">This method will create an empty ZIP archive if needed.</font></font><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><br>
</font></li>
                  </ul>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Here is a sample under a Win32 OS. We assume that D:\Inetpub\customers\ is RW for the process running the Servlets/JSP Engine.<br>
</font></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td bgcolor="#333333"> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td bgcolor="#EEEEEE"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">&lt;jsp:useBean id=&quot;upBean&quot; scope=&quot;session&quot; class=&quot;javazoom.upload.UploadBean&quot;&gt;<br>
</font><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">&nbsp;&nbsp;&lt;jsp:setProperty name=&quot;<b>upBean</b>&quot; property=&quot;<b><font color="#FF0000">zipfilestore</font></b>&quot; <br>
&nbsp;&nbsp; value=&quot;<b>D:/Inetpub/customers/uploads.zip</b>&quot; /&gt;<br>
&lt;/jsp:useBean&gt;</font></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><u><font color="#333333" size="-2"><b>Notes</b></font></u><font color="#333333"><b><font size="-2"> : </font></b><font size="-2"><br>
1 - Appending process could be slow because UploadBean need to create a temporary archive. Try to avoid big archives.<br>
2 - Don't pay attention about &quot;/&quot; or &quot;\&quot; in path. UploadBean will use always use the good one.<br>
3 - </font><font size="-2" face="Verdana, Arial, Helvetica, sans-serif">A full sample is available through <a href="../MultipleUploads.jsp">MultipleUploads.jsp</a></font></font><br>
</font></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td valign="top" bgcolor="#FFFFCC"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/right_red-arrow.gif" width="18" height="14" align="absmiddle">&nbsp;</font><font color="#FF0000">Database </font><font color="#FF0000">:</font><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><a name="database"></a></font></b></font></td>
                    </tr>
                  </table>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><b><img src="img/database.gif" width="33" height="35" align="left"></b>UploadBean can store uploaded files in any database supporting long RAW data (i.e. binary files). You need a table (UPLOADS) with one column for upload identifiers (UPLOADID), one column for uploaded filenames (FILENAME) and one column for binary data (BINARYFILE). Note that you can modify tables and columns names through SQLUPLOAD* public static fields of UploadBean class. <br>
                      <br>
Two methods are available to initialize to JDBC connection :<br>
</font></p>
                  <ul>
                    <li><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">public void <b>setDatabasestore</b>(String driver, String URL, Properties credentials)<br>
                        <font color="#666666">Inputs parameters are the JDBC driver identifier, the JDBC URL and some connection properties (usually login/password).</font><br>
                        <font color="#666666">This method will load the driver in memory and open a database connection. </font></font></li>
                    <li><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">public void <b>setDatabasestore</b>(Connection jdbcconnection)<br>
                        <font color="#666666">Input parameter is a database connection that could come from a DataSource or any connection pool.</font><br>
</font></li>
                  </ul>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">One method is available to replace database store implementation :<br>
</font></p>
                  <ul>
                    <li><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">public void <b>setDatabasestoreimplementation</b>(String newimpl)<br>
                        <font color="#666666">Inputs parameter is your extended DBStore classname. See note 5 below. </font></font></li>
                  </ul>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Here is a sample for Oracle. We assume that ORCL is a database instance running on mydbhost server (port 1521) and a test (login=test, password=test) account is available. A table matches to the <a href="sql/upload_oracle.sql">upload_oracle.sql</a> script. We also assume that we're using the Oracle THIN JDBC driver.<br>
</font></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td bgcolor="#333333"> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td bgcolor="#EEEEEE"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">&lt;jsp:useBean id=&quot;upBean&quot; scope=&quot;application&quot; class=&quot;javazoom.upload.UploadBean&quot;&gt;<br>
&lt;%<br>
&nbsp;&nbsp;Properties props = new Properties();<br>
&nbsp;&nbsp;props.put(&quot;<b>user</b>&quot;,&quot;<b>test</b>&quot;);<br>
&nbsp;&nbsp;props.put(&quot;<b>password</b>&quot;,&quot;<b>test</b>&quot;);<br>
&nbsp;&nbsp;<b>upBean</b>.<font color="#FF0000"><b>setDatabasestore</b>(&quot;</font><b>oracle.jdbc.driver.OracleDriver</b><font color="#FF0000">&quot;,<br>
&nbsp;&nbsp;</font></font><font size="-2" face="Verdana, Arial, Helvetica, sans-serif"><font size="-1" color="#FF0000">&nbsp;&quot;</font><font size="-1"><b>jdbc:oracle:thin:@mydbhost:1521:ORCL</b><font color="#FF0000">&quot;,</font> <b>props</b><font color="#FF0000">);</font><br>
%&gt;<br>
&lt;/jsp:useBean&gt;</font></font></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <p><font size="-2" face="Verdana, Arial, Helvetica, sans-serif"><font size="-1"><u><font color="#333333" size="-2"><b>Notes</b></font></u><font color="#333333"><b><font size="-2"> : </font></b><font size="-2"><br>
1 - &quot;scope=application&quot; is recommended to avoid multiples database connections.&quot;scope=session is acceptable small amount of users. &quot;scope=request&quot; is not recommended without JDBC ConnectionPool.<br>
2 - <b>UploadBean won't close the database connection</b>. You can do it when needed by calling :<br>
upBean.getDatabasestore().close(</font></font></font><font color="#333333" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><font size="-2">)<br>
3 - </font><font size="-2" face="Verdana, Arial, Helvetica, sans-serif">A full sample is available through <a href="../DatabaseUpload.jsp">DatabaseUpload.jsp</a></font></font><br>
<font color="#333333" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><font size="-2">4 - </font><font size="-2" face="Verdana, Arial, Helvetica, sans-serif">For DB2 script see <a href="sql/upload_db2.sql">upload_db2.sq</a>l, for PostGreSQL see <a href="sql/upload_postgresql.sql">upload_postgresql.sql</a> and for MySQL script see <a href="sql/upload_mysql.sql">upload_mysql.sql</a></font></font><br>
<font color="#333333" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><font size="-2">5 - </font><font size="-2" face="Verdana, Arial, Helvetica, sans-serif">If UploadBean database store does not suit to your needs then you could implement your own <a href="api.html">DBStore</a>. A sample is available in&nbsp;<a href="http://www.javazoom.net/jzservlets/uploadbean/uploadbeantools.html">add-ons</a> section.<br>
</font></font><font size="-1"><br>
</font></font></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td valign="top" bgcolor="#FFFFCC"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/right_red-arrow.gif" width="18" height="14" align="absmiddle">&nbsp;</font><font color="#FF0000">Memory </font><font color="#FF0000">:</font><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><a name="memory"></a></font></b></font></td>
                    </tr>
                  </table>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><font size="-2" face="Verdana, Arial, Helvetica, sans-serif"><b><img src="img/memory2.gif" width="41" height="44" align="left"></b></font>UploadBean can store uploaded files in JVM memory. Uploaded files will be stored in a &quot;Vector&quot; object. This is a vector of &quot;UploadFile&quot; objects (see <a href="api/index.html" target="_top">API</a> to learn more).<br>
                      <br>
One method is available to initialize the memory store :<br>
</font></p>
                  <ul>
                    <li><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">public void <b>setStoremodel</b>(int storeid)<br>
                        <font color="#666666">Input parameter is a store identifier for MEMORYSTORE.</font></font><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><br>
</font></li>
                  </ul>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Here is a sample.<br>
</font></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td bgcolor="#333333"> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td bgcolor="#EEEEEE"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">&lt;jsp:useBean id=&quot;upBean&quot; scope=&quot;session&quot; class=&quot;javazoom.upload.UploadBean&quot;&gt;<br>
&nbsp;&nbsp;&lt;jsp:setProperty name=&quot;<b>upBean</b>&quot; property=&quot;<b><font color="#FF0000">storemodel</font></b>&quot;<br>
&nbsp;&nbsp; value=&quot;<b>&lt;%= UploadBean.MEMORYSTORE %&gt;</b>&quot; /&gt;</font><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><br>
&lt;/jsp:useBean&gt;</font></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><u><font color="#333333" size="-2"><b>Notes</b></font></u><font color="#333333"><b><font size="-2"> : </font></b><font size="-2"><br>
1 - Using memory store without &quot;scope=session&quot; or </font><font color="#333333" size="-2" face="Verdana, Arial, Helvetica, sans-serif">&quot;scope=application&quot;</font><font size="-2"> is not really useful.<br>
2 - You can access the memory store through upBean.getMemorystore().<br>
3 - All data will be lost when the servlet engine stops (or crashes).<br>
<br>
</font></font> </font></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td valign="top" bgcolor="#FFFFCC"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/right_red-arrow.gif" width="18" height="14" align="absmiddle">&nbsp;</font><font color="#FF0000">Switch to another model </font><font color="#FF0000">:<a name="setstoremodel"></a></font></b></font></td>
                    </tr>
                  </table>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">One method is available to switch to another store model. It could be useful if, depending on file's Content-Type, you want to switch to folder or zipfile store.<br>
</font></p>
                  <ul>
                    <li><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">public void <b>setStoremodel</b>(int storeid)<br>
                        <font color="#666666">Input parameter is a store identifier..</font></font><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><br>
</font></li>
                  </ul>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Here is a sample.<br>
</font></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td bgcolor="#333333"> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td bgcolor="#EEEEEE"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">&lt;some HTML ...<br>
&nbsp;&nbsp;&lt;jsp:setProperty name=&quot;<b>upBean</b>&quot; property=&quot;<b><font color="#FF0000">storemodel</font></b>&quot;<br>
&nbsp;&nbsp; value=&quot;<b>&lt;%= UploadBean.ZIPFILESTORE %&gt;</b>&quot; /&gt;<br>
... some HTML&gt;</font></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><u><font color="#333333" size="-2"><b><br>
Note</b></font></u><font color="#333333"><b><font size="-2"> : </font></b><font size="-2"><br>
- Each storemodel had to been initialized before switching.</font></font></font><br>
                  <br>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td valign="top" bgcolor="#FFFFCC"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/right_red-arrow.gif" width="18" height="14" align="absmiddle">&nbsp;</font><font color="#FF0000">Blacklist</font><font color="#FF0000">:</font><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><a name="blacklist"></a></font></b></font></td>
                    </tr>
                  </table>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><font size="-2" face="Verdana, Arial, Helvetica, sans-serif"><b><img src="img/blacklist.gif" width="48" height="48" align="left"></b></font>UploadBean can filter uploaded files through a blacklist. A blacklist is a list of filenames you don't want to be uploaded/stored (i.e list of denied filenames). If someone try to upload a forbidden file then UploadBean will throw an exception.<br>
                      <br>
One method is available to initialize the blacklist :<br>
</font></p>
                  <ul>
                    <li><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">public void <b>setBlacklist</b>(String list)<br>
                        <font color="#666666">Input parameter is a list of filenames seperated by coma.</font></font><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><br>
</font></li>
                  </ul>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Here is a sample.<br>
</font></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td bgcolor="#333333"> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td bgcolor="#EEEEEE"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">&lt;jsp:useBean id=&quot;upBean&quot; scope=&quot;session&quot; class=&quot;javazoom.upload.UploadBean&quot;&gt;<br>
&nbsp;&nbsp;&lt;jsp:setProperty name=&quot;<b>upBean</b>&quot; property=&quot;<b><font color="#FF0000">blacklist</font></b>&quot;<br>
&nbsp;&nbsp; value=&quot;<b>*.zip,*.rar,setup.exe</b>&quot; /&gt;</font><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><br>
&lt;/jsp:useBean&gt;</font></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <br>
                  <br>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td valign="top" bgcolor="#FFFFCC"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/right_red-arrow.gif" width="18" height="14" align="absmiddle">&nbsp;</font><font color="#FF0000">Whitelist</font><font color="#FF0000">:</font><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><a name="whitelist"></a></font></b></font></td>
                    </tr>
                  </table>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><font size="-2" face="Verdana, Arial, Helvetica, sans-serif"><b><img src="img/blacklist.gif" width="48" height="48" align="left"></b></font>UploadBean can filter uploaded files through a whitelist. A whitelist is a list of filenames that could be uploaded/stored (i.e list of allowed filenames). If someone try to upload a file NOT in whitelist then UploadBean will throw an exception. An empty whitelist means that you can't upload any file. <u>UploadBean allows Blacklist or Whitelist but NOT both</u>. Default is an empty blacklist (all files allowed).<br>
                      <br>
One method is available to initialize the blacklist :<br>
</font></p>
                  <ul>
                    <li><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">public void <b>setWhitelist</b>(String list)<br>
                        <font color="#666666">Input parameter is a list of filenames seperated by coma.</font></font><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><br>
</font></li>
                  </ul>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Here is a sample.<br>
</font></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td bgcolor="#333333"> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td bgcolor="#EEEEEE"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">&lt;jsp:useBean id=&quot;upBean&quot; scope=&quot;session&quot; class=&quot;javazoom.upload.UploadBean&quot;&gt;<br>
&nbsp;&nbsp;&lt;jsp:setProperty name=&quot;<b>upBean</b>&quot; property=&quot;<b><font color="#FF0000">whitelist</font></b>&quot; value=&quot;<b>*.ogg,*.mp3</b>&quot; /&gt;</font><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><br>
&lt;/jsp:useBean&gt;</font></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <br>
                  <br>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td valign="top" bgcolor="#FFFFCC"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/right_red-arrow.gif" width="18" height="14" align="absmiddle">&nbsp;</font><font color="#FF0000">Overwrite </font><font color="#FF0000">:</font><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><a name="overwrite"></a></font></b></font></td>
                    </tr>
                  </table>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/overwrite.gif" width="35" height="35" align="left">UploadBean can check for duplicates entries on upload. Then it can overwrite the entry or create a new entry by appending a timestamp to filename extension.<br>
                      <br>
One method is available to enable/disable overwriting and one for renaming option :<br>
</font></p>
                  <ul>
                    <li><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">public void <b>setOverwrite</b>(boolean enable)<br>
                    <font color="#666666"> Default is false, so overwrite is disabled. </font></font></li>
                    <li><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">public void <b>setOverwritepolicy</b>(String policy)<br>
                        <font color="#666666"> When overwrite is false, UploadBean could append  unix-like timestamp after the file extension (e.g. filename.zip.123456789) with policy=&quot;filenametimestamp&quot; or after the file name (e.g. filename_123456789.zip) with policy=&quot;nametimestamp&quot;. For  others policy</font> <font color="#666666">values it will insert the given parameter, for instance if overwrite policy=&quot;_test123&quot; then renamed file with be filename_test123.zip. </font></font><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><br>
                                            </font></li>
                  </ul>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Here is a sample.<br>
</font></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td bgcolor="#333333"> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td bgcolor="#EEEEEE"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">&lt;jsp:useBean id=&quot;upBean&quot; scope=&quot;session&quot; class=&quot;javazoom.upload.UploadBean&quot;&gt;<br>
&nbsp;&nbsp;&lt;jsp:setProperty name=&quot;<b>upBean</b>&quot; property=&quot;<b><font color="#FF0000">overwrite</font></b>&quot;<br>
&nbsp;&nbsp; value=&quot;<b>true</b>&quot; /&gt;<br>
&lt;/jsp:useBean&gt;</font></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><br>
                  <u><font color="#333333" size="-2"><b>Notes</b></font></u><font color="#333333"><b><font size="-2"> : </font></b><font size="-2"><br>
1 - For folder and zip store, <font size="-2" face="Verdana, Arial, Helvetica, sans-serif">you could get the new filename through UploadParameters.getAltFilename()</font>.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
                  </font><font size="-2" face="Verdana, Arial, Helvetica, sans-serif">2 - For database store (default implementation), overwrite=false will insert a new record, <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;overwrite=true will update it.</font><font size="-2"><br>
3 - For memory store, all uploaded files are appended to a list. overwrite is useless<br>
</font></font></font><br>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td valign="top" bgcolor="#FFFFCC"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/right_red-arrow.gif" width="18" height="14" align="absmiddle">&nbsp;</font><font color="#FF0000">File size limit:</font><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><a name="limit"></a></font></b></font></td>
                    </tr>
                  </table>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><font size="-2" face="Verdana, Arial, Helvetica, sans-serif"><b><img src="img/limit.gif" width="51" height="40" align="left"></b></font>UploadBean can filter uploaded files on size. The file size limit is in bytes. If someone try to upload a file which size is above of the one allowed then UploadBean will throw an exception.<br>
                      <br>
One method is available to setup file size limit :<br>
</font></p>
                  <ul>
                    <li><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">public void <b>setFilesizelimit</b>(int sizelimitinbytes)<br>
                        <font color="#666666">Input parameter is file size limit in bytes. Default is 1GB.</font><br>
</font></li>
                  </ul>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Here is a sample.<br>
</font></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td bgcolor="#333333"> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td bgcolor="#EEEEEE"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">&lt;jsp:useBean id=&quot;upBean&quot; scope=&quot;session&quot; class=&quot;javazoom.upload.UploadBean&quot;&gt;<br>
&nbsp;&nbsp;&lt;jsp:setProperty name=&quot;<b>upBean</b>&quot; property=&quot;<b><font color="#FF0000">filesizelimit</font></b>&quot;<br>
&nbsp;&nbsp; value=&quot;<b>1048576</b>&quot; /&gt;<br>
&lt;/jsp:useBean&gt;</font></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <br>
                  <br>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td valign="top" bgcolor="#FFFFCC"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/right_red-arrow.gif" width="18" height="14" align="absmiddle">&nbsp;</font><font color="#FF0000">Maximum uploaded files for a store :</font><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><a name="max"></a></font></b></font></td>
                    </tr>
                  </table>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><font size="-2" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/stop.jpg" width="46" height="46" align="left"></font>UploadBean can manage stores with upper limit. The limit is the maximum number of uploaded files. If someone try to upload more files than allowed by the current store then UploadBean will throw an exception.<br>
                      <br>
One method is available to setup maximum files for the current store :<br>
</font></p>
                  <ul>
                    <li><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">public void <b>setMaxfiles</b>(int amountallowed)<br>
                        <font color="#666666">Input parameter is the maximum number of files in a store. Default is -1 (unlimited).</font><br>
</font></li>
                  </ul>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Here is a sample.<br>
</font></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td bgcolor="#333333"> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td bgcolor="#EEEEEE"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">&lt;jsp:useBean id=&quot;upBean&quot; scope=&quot;session&quot; class=&quot;javazoom.upload.UploadBean&quot;&gt;<br>
&nbsp;&nbsp;&lt;jsp:setProperty name=&quot;<b>upBean</b>&quot; property=&quot;<b><font color="#FF0000">maxfiles</font></b>&quot;<br>
&nbsp;&nbsp; value=&quot;<b>10</b>&quot; /&gt;<br>
&lt;/jsp:useBean&gt;</font></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <br>
                  <br>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td valign="top" bgcolor="#FFFFCC"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/right_red-arrow.gif" width="18" height="14" align="absmiddle">&nbsp;</font><font color="#FF0000">Store methods :</font><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><a name="storecall"></a></font></b></font></td>
                    </tr>
                  </table>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/store.gif" width="40" height="52" align="left">UploadBean moves uploaded file(s) from MultipartFormDataRequest object to the defined store. UploadBean will check all restrictions before storing file(s).<br>
                      <br>
                      <br>
Two methods are available to store uploaded files from MultipartFormDataRequest :<br>
</font></p>
                  <ul>
                    <li><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">public void <b>store</b>(MultipartFormDataRequest mrequest, String field)<br>
                        <font color="#666666">Inputs parameters are a MultipartFormDataRequest object and the form field identifier matching to the file you want to store.</font></font></li>
                    <li><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">public void <b>store</b>(MultipartFormDataRequest mrequest)<br>
                        <font color="#666666">Input parameter is a MultipartFormDataRequest object. UploadBean will save all files available in the </font><font color="#666666" size="-1" face="Verdana, Arial, Helvetica, sans-serif">MultipartFormDataRequest</font><font color="#666666"> object.</font><br>
</font></li>
                  </ul>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Here is a sample.<br>
</font></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td bgcolor="#333333"> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td bgcolor="#EEEEEE"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">&lt;%<br>
&nbsp;&nbsp;if (MultipartFormDataRequest.isMultipartFormData(request))<br>
&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#003300">// Uses MultipartFormDataRequest to parse the HTTP request.</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MultipartFormDataRequest mrequest = new MultipartFormDataRequest(request);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>upBean.<font color="#FF0000">store</font>(mrequest);</b><br>
&nbsp;&nbsp;}<br>
%&gt;</font></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <br>
                  <font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><u><font color="#333333" size="-2"><b>Notes</b></font></u><font color="#333333"><b><font size="-2"> : </font></b><font size="-2"><br>
1 - UploadBean will not save anything if you don't call this method.<br>
2 - In the example above, request is the implicit HttpServletRequest object.<br>
3 - Store is synchronized for ZIP Archive so don't worry about file locking.<br>
<br>
<br>
</font></font></font> 
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td valign="top" bgcolor="#FFFFCC"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/right_red-arrow.gif" width="18" height="14" align="absmiddle">&nbsp;</font><font color="#FF0000">MultipartFormDataRequest :</font><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><a name="mp"></a></font></b></font></td>
                    </tr>
                  </table>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/htmlicon.jpg" width="53" height="38" align="left">UploadBean extracts uploaded file(s) from a MultipartFormDataRequest instance. This class handles &quot;<b>multipart/form-data</b>&quot; enctype from your HTML form. You need to encode form data as &quot;multipart/form-data&quot; to upload files through a browser. You can't use enctype=&quot;application/x-www-form-urlencoded&quot;.<br>
                      <br>
MultipartFormData is not the core of UploadBean, you don't need it except to get form parameters and values. See <a href="api/index.html" target="_top">API</a> to learn more about it.<br>
</font></p>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Here is a sample.<br>
</font></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td bgcolor="#333333"> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td bgcolor="#EEEEEE"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">&lt;%<br>
 &nbsp;&nbsp;&nbsp;if (MultipartFormDataRequest.isMultipartFormData(request))<br>
&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#003300">// Uses MultipartFormDataRequest to parse the HTTP request.</font><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MultipartFormDataRequest <b>mrequest</b> = new MultipartFormDataRequest(<font color="#FF0000">request</font>);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String todo = <b>mrequest.<font color="#FF0000">getParameter</font></b>(&quot;todo&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( (todo != null) &amp;&amp; (todo.equalsIgnoreCase(&quot;upload&quot;)) )<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;... <br>
%&gt;</font></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <br>
                  <font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><u><font color="#333333" size="-2"><b>Notes</b></font></u><font color="#333333"><b><font size="-2"> : </font></b><font size="-2"><br>
                  1 - In the example above, request is the implicit HttpServletRequest object.<br>
2 - In addition to <a href="developerguide.html#parser">parser</a> property you could select the multipart parser through the MultipartFormDataRequest constructor.<br>
<br>
<br>
                  </font></font></font> 
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td valign="top" bgcolor="#FFFFCC"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/right_red-arrow.gif" width="18" height="14" align="absmiddle">&nbsp;</font><font color="#FF0000">Reset a store :</font><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><a name="clean"></a></font></b></font></td>
                    </tr>
                  </table>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/reset.gif" width="44" height="43" align="left">UploadBean can reset store. For database store it will delete records. For ZIP Archive store it will empty archive. For folder store it will delete all files. For memory store it will free memory.<br>
                      <br>
One method is available to reset store :<br>
</font></p>
                  <ul>
                    <li><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">public void <b>resetStore</b>()<br>
                        <font color="#666666">No input parameters.</font><br>
</font></li>
                  </ul>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Here is a sample.<br>
</font></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td bgcolor="#333333"> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td bgcolor="#EEEEEE"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">&lt;%<br>
&nbsp;&nbsp;&nbsp;upBean.<b>resetStore</b>();<br>
%&gt;</font></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <br>
                  <br>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td valign="top" bgcolor="#FFFFCC"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/right_red-arrow.gif" width="18" height="14" align="absmiddle">&nbsp;</font><font color="#FF0000">UploadListener :</font><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><a name="listener"></a></font></b></font></td>
                    </tr>
                  </table>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/notify.gif" width="68" height="34" align="left">UploadBean can notify listeners implementing UploadListener interface. Notification will be done only if restrictions are passed and uploaded file is stored. Callback parameter is an UploadParameters instance (file info).<br>
                      <br>
One method is available to register a listener :<br>
</font></p>
                  <ul>
                    <li><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">public void <b>addUploadListener</b>(UploadListener listener)<br>
                        <font color="#666666">Input parameter is the listener instance.</font><br>
</font></li>
                  </ul>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Here is a sample.<br>
</font></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td bgcolor="#333333"> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td bgcolor="#EEEEEE"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">some Java code<br>
&nbsp;&nbsp;&nbsp;... <br>
&nbsp;&nbsp;&nbsp;myListener lst=new myListener();<br>
&nbsp;&nbsp; upBean.<b>addUploadListener</b>(lst);<br>
&nbsp;&nbsp;&nbsp;... </font></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <br>
                  <br>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td valign="top" bgcolor="#FFFFCC"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/right_red-arrow.gif" width="18" height="14" align="absmiddle">&nbsp;</font><font color="#FF0000">History :</font><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><a name="history"></a></font></b></font></td>
                    </tr>
                  </table>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/history.gif" width="32" height="32" align="left">UploadBean tracks all uploaded files information (filename, filesize, content-type, storemodel, storeinfo). You can get the history of uploads (Vector of UploadParameters).<br>
                      <br>
One method is available to get history :<br>
</font></p>
                  <ul>
                    <li><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">public Vector <b>getHistory</b>()<br>
                        <font color="#666666">No input parameters.</font><br>
</font></li>
                  </ul>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Here is a sample.<br>
</font></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td bgcolor="#333333"> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td bgcolor="#EEEEEE"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"> &lt;%<br>
&nbsp;&nbsp;&nbsp;&nbsp;Vector history = <b>upBean.<font color="#FF0000">getHistory</font>()</b>;<br>
&nbsp;&nbsp;&nbsp;&nbsp;for (int i=0;i&lt;history.size();i++)<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>UploadParameters</b> up = (<b>UploadParameters</b>) history.elementAt(i);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;out.println(&quot;&lt;li&gt;Uploaded file : &quot;+up.<b>getFilename</b>()+&quot; (&quot;+up.<b>getFilesize</b>()+<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;bytes)&quot;+&quot;&lt;BR&gt; Content Type : &quot;+up.<b>getContenttype</b>());<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;out.println(&quot;&lt;BR&gt;StoreModel : &quot;+up.<b>getStoremodelname</b>()+<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot; (&quot;+up.<b>getStoreinfo</b>()+&quot;)&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;}<br>
%&gt;</font></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <br>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td valign="top" bgcolor="#FFFFCC"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/right_red-arrow.gif" width="18" height="14" align="absmiddle">&nbsp;</font><font color="#FF0000">Parser :</font><font color="#FF0000" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><a name="parser"></a></font></b></font></td>
                    </tr>
                  </table>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><img src="img/parser.gif" width="48" height="48" align="left">UploadBean supports two multipart parsers (cos and struts). You can select one through parser property. Default one is cos.<br>
                      <br>
Two methods are available to select and setup parser :<br>
</font></p>
                  <ul>
                    <li><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">public void <b>setParser</b>(String parserid)<br>
                        <font color="#666666">Input parameter is a string that could take values among MultipartFormDataRequest.COSPARSER, <br>
                        </font><font color="#666666" size="-1" face="Verdana, Arial, Helvetica, sans-serif">MultipartFormDataRequest.STRUTSPARSER</font><font color="#666666"> and<br>
                        </font><font color="#666666" size="-1" face="Verdana, Arial, Helvetica, sans-serif">MultipartFormDataRequest.CFUPARSER</font><font color="#666666">.</font></font></li>
                    <li><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">public void <b>setParsertmpdir</b>(String tmpdir)<br>
                        <font face="Verdana, Arial, Helvetica, sans-serif" size="-1" color="#666666">Input parameter allowing to select the tempory directory (cache) for Struts and Commons-FileUpload parsers only.</font><br>
</font></li>
                  </ul>
                  <p><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Here is a sample for CFU parser.<br>
</font></p>
                  <table width="100%" border="0" cellspacing="1" cellpadding="1">
                    <tr> 
                      <td bgcolor="#333333"> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td bgcolor="#EEEEEE"><font size="-1" face="Verdana, Arial, Helvetica, sans-serif">&lt;jsp:useBean id=&quot;upBean&quot; scope=&quot;page&quot; class=&quot;javazoom.upload.UploadBean&quot; &gt;<br>
&nbsp;&nbsp;&lt;jsp:setProperty name=&quot;<b>upBean</b>&quot; property=&quot;folderstore&quot; value=&quot;D:/uploads&quot;/&gt;<br>
&nbsp;&nbsp;&lt;jsp:setProperty name=&quot;<b>upBean</b>&quot; property=&quot;<b><font color="#FF0000">parser</font></b>&quot;<br>
&nbsp;&nbsp;&nbsp; value=&quot;<b>&lt;%= MultipartFormDataRequest.CFUPARSER %&gt;</b>&quot;/&gt;<br>
&nbsp;&nbsp;&lt;jsp:setProperty name=&quot;upBean&quot; property=&quot;<b><font color="#FF0000">parsertmpdir</font></b>&quot; value=&quot;D:/temp&quot;/&gt;<br>
&lt;/jsp:useBean&gt;</font></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <p><font color="#333333" size="-1" face="Verdana, Arial, Helvetica, sans-serif"> <font size="-1" face="Verdana, Arial, Helvetica, sans-serif"><u><font size="-2"><b>Notes</b></font></u><b><font size="-2"> : </font></b><font size="-2"><br>
                  1 - </font></font><font size="-2">To learn more about pros and cons of multipart parser check you the following <a href="http://www.javazoom.net/services/forums/viewMessage.jsp?message=3993&thread=1200&forum=10&parent=-1" target="_blank">thread</a> in our online forum.</font></font><br>
                    <br>
                  </p>
                </td>
              </tr>
            </table>
          </td>
        </tr>
        <tr nowrap>
          <td width="146" valign="top">&nbsp;</td>
          <td align="center" valign="top"><table border="0" cellspacing="1" cellpadding="0" vspace="0" hspace="0" name="Short Menu" width="100%" align="center" height="30">
            <tr>
              <td nowrap align="center" width="14%" bgcolor="#FFFF99"> <font size="-2" face="Arial, Helvetica, sans-serif"><a href="http://www.javazoom.net" target="_top">[News]</a></font> </td>
              <td nowrap align="center" width="14%" bgcolor="#FFFF99"> <font size="-2" face="Arial, Helvetica, sans-serif"><a href="http://www.javazoom.net/applets/applets.html" target="_top">[Applets]</a></font> </td>
              <td nowrap align="center" width="14%" bgcolor="#FFFF99"> <font size="-2" face="Arial, Helvetica, sans-serif"><a href="http://www.javazoom.net/jzservlets/servlets.html" target="_top">[Servlets]</a></font> </td>
              <td nowrap align="center" width="16%" bgcolor="#FFFF99"> <font size="-2" face="Arial, Helvetica, sans-serif"><a href="http://www.javazoom.net/services/services.html"
        target="_top">[Services]</a></font> </td>
              <td nowrap width="14%" align="center" bgcolor="#FFFF99"> <font size="-2" face="Arial, Helvetica, sans-serif"><a href="http://www.javazoom.net/javalayer/javalayer.html" target="_top">[Projects]</a></font> </td>
              <td nowrap align="center" width="14%" bgcolor="#FFFF99"> <font size="-2" face="Arial, Helvetica, sans-serif"><a href="http://www.javazoom.net/links/links.html" target="_top">[Links]</a></font> </td>
              <td nowrap align="center" width="14%" bgcolor="#FFFF99"> <font size="-2" face="Arial, Helvetica, sans-serif"><a href="http://www.javazoom.net/links/links.html" target="_top">[About]</a></font> </td>
            </tr>
          </table></td>
        </tr>
        <tr nowrap>
          <td valign="top">&nbsp;</td>
          <td align="center" valign="top"><p><font size="-1" face="Courier New, Courier, mono">Copyright &copy; JavaZOOM 1999-2006</font></p>
            <p><font size="-2" face="Arial, Helvetica, sans-serif"><a href="http://java.sun.com" target="_blank">Java</a> and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U. S. and other countries.<br />
  All other company and/or product names are the property of their respective owners.</font></p></td>
        </tr>
      </table>    </td>
  </tr>
</table>
</body>
</html>
